//
//  City.m
//  Utils
//
//  Created by enghou on 2018/4/21.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "City.h"

@implementation City
-(instancetype)initWithSource:(NSDictionary *)source{
    self = [super initWithSource:source];
    if (self) {
        self.name = [source objectForKey:@"city"];
        NSArray *country = [source objectForKey:@"areas"];
        NSMutableArray *arr = [NSMutableArray array];
        for (NSString *element in country) {
            Country *c = [[Country alloc]initWithSource:@{}];
            c.name = element;
            [arr addObject:c];
        }
        self.countrys = arr;
    }
    return self;
}
@end
